﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Add.aspx.cs" Inherits="CSP.Web.MyHome.ServiceManage.Add" %>

<%@ Register Assembly="DropDownCheckList" Namespace="UNLV.IAP.WebControls" TagPrefix="cc1" %>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>添加产品</title>
    <link rel="stylesheet" href="./static/js/bd_main.css" />
    <link href="static/css/multidropdown.css" rel="stylesheet" />
    <style>
        .edui-default .edui-box {
            *float: left !important;
        }

        #edui60, #edui61 {
            *display: none;
        }

        .edui-default .edui-editor .edui-editor-iframeholder {
            *position: absolute;
            *border: 1px solid #D4D4D4;
        }

        #product-tag {
            border-top: 2px solid #327FC7;
            float: left;
        }

        #quota-tip {
            display: none;
            margin: 6px 25px 0;
            *margin-top: -15px;
        }

        #chkKnowList {
            width: 100%;
        }

            #chkKnowList tr {
                width: 20%;
                float: left;
            }

        #ddlServiceArea {
            width: 100%;
        }

            #ddlServiceArea tr {
                float: left;
            }

            #ddlServiceArea td {
                width: 75px;
            }

                #ddlServiceArea td label {
                    width: 60px;
                    overflow: hidden;
                    margin-top: -2px;
                    text-align: left;
                }
    </style>
    <style>
        * {
            padding: 0px;
            margin: 0px;
        }

        UL {
            list-style-type: none;
        }

        LI {
            list-style-type: none;
        }



        BODY {
            color: #666b76;
            font-family: "微软雅黑","宋体",arial;
            font-size: 14px;
            margin: 0px;
        }

        .left {
            float: left;
        }

        LABEL {
            vertical-align: top;
        }

        .subarea input {
            padding: 5px;
        }

        .clearfix:after {
            height: 0px;
            overflow: hidden;
            clear: both;
            display: block;
            visibility: hidden;
            content: ".";
        }

        .clearfix {
            display: block;
            zoom: 1;
        }

        .red {
            color: red;
        }

        .question_list .item {
            position: relative;
            margin-top: 5px;
        }

        .question_list .clean {
            position: absolute;
            top: 2px;
            right: 5px;
            cursor: pointer;
            padding: 2px;
            border-radius: 3px;
            display: none;
        }

        .question_list .item select {
            width: 120px;
        }

        .sub_item {
            padding: 5px;
            margin: 5px 10px;
            border-radius: 5px;
            display: none;
        }

        .question_list .item-title {
            margin: 0 0 2px 10px;
        }

        .item-vals {
            /*display: none;*/
        }

        .item-shows {
            display: inline;
        }

        .question_list .item-vals {
            padding: 10px;
        }

        .qtip {
            margin-bottom: 5px;
            color: #666;
        }

        h3 {
            font-size: 14px;
        }

        #permit_main {
            width: 100%;
            /*padding-bottom: 20px;*/
            overflow-x: hidden;
            margin: 0 5px 10px 5px;
            position: relative;
            height: 100%;
        }

        #zr_error {
            display: none;
        }

        .divstyle {
            width: 33%;
            overflow: hidden;
            float: left;
            padding: 8px 0px;
        }

        .spanstyle {
            width: 90px;
            overflow: hidden;
            float: left;
            text-align: left;
            white-space: nowrap;
            word-break: keep-all;
        }
    </style>

    <script src="./static/js/jquery-1.7.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="./static/js/common.js"></script>
    <script type="text/javascript" src="./static/js/bd-common.js"></script>
    <!--[if lt IE 8]>
    <link href="/static/js/ie678.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="./static/js/DD_belatedPNG_0.0.8a.js"></script>
    <script type="text/javascript">
      DD_belatedPNG.fix('.pngfix');
    </script>
    <![endif]-->
</head>
<body>
    <div id="header">
        <div class="header">
            <div id="logo">
                <span class="logo"><a href="http://www.xinranzixun.com/">
                    <img src="../../images/xinran.jpg" /></a></span>
                <div class="quick-menu">
                    <ul>
                        <li>您好 高先生! <a href="http://www.xinranzixun.com/bd/logout.html">[退出]</a></li>
                        <li>
                            <div>
                                <a href="http://www.xinranzixun.com/bd/mailinfo/list.html">
                                    <div style="float: left">
                                        <img src="./static/images/msg.png" />
                                    </div>
                                </a>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="nav">
                <ul>
                    <li>
                        <a href=""><span>首页</span></a>
                    </li>
                    <li class="here">
                        <a href=""><span class="banker_new_q">客户申请资格</span></a>
                    </li>
                    <li>
                        <a href=""><span>我的业务查询</span></a>
                    </li>
                    <li>
                        <a href=""><span>我的报表</span></a>
                    </li>
                    <li>
                        <a href=""><span>下载专区</span></a>
                    </li>
                    <li>
                        <a href=""><span>个人信息</span></a>
                    </li>
                    <li>
                        <a href=""><span>常见问题</span></a>
                    </li>
                </ul>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div id="main">
        <div id="leftmain">
            <ul>
                <li>
                    <a href="Detail.aspx">产品管理</a>
                </li>
                <li>
                    <a href="ServiceCause.aspx">限制管理</a>
                </li>
                <li class="here">
                    <a href="Add.aspx">产品新增</a><li>
            </ul>
        </div>
        <div id="wrapper" class="clearfix" style="overflow: hidden;">
            <div id="rightmain">
                <form id="DataPost" runat="server" method="post">
                    <div class="title">
                        <h2>创建新产品</h2>

                        <div style="font-size: 12px; color: red">
                            请勿将电话、邮件等隐私信息填写在产品信息中，平台会进行审核并删除不符合此要求的产品
                        </div>
                    </div>
                    <div class="add-product">
                        <h4>基本信息<span class="tail-text">（全部为必填）</span></h4>
                        <div class="item">
                            <label>产品名称：</label><asp:TextBox ID="pdata_name" class="inpt inpt-lg" runat="server"></asp:TextBox>
                        </div>
                        <div class="item">
                            <label>产品编码：</label><asp:TextBox ID="pdata_ad" runat="server" CssClass="inpt inpt-lg"></asp:TextBox>
                        </div>
                        <%-- <div class="item">
                            <label>产品类型：</label>
                            <asp:DropDownList ID="pdata_type" CssClass="inpt inpt-lg" runat="server">
                                <asp:ListItem Value="52" Text="个人"></asp:ListItem>
                                <asp:ListItem Value="53" Text="企业"></asp:ListItem>
                            </asp:DropDownList>
                        </div>
                        <div class="item">
                            <label>年龄段：</label>
                            <asp:DropDownList ID="guarantee_type" class="inpt inpt-lg" runat="server"></asp:DropDownList>
                        </div>--%>
                        <div class="item">
                            <label>额度范围：</label><asp:TextBox CssClass="inpt inpt-sm" data-format="number" ID="txtEduStart" runat="server"></asp:TextBox>
                            万 -<asp:TextBox ID="txtEduEnd" CssClass="inpt inpt-sm" data-format="number" runat="server"></asp:TextBox>
                            万<span class="inpt-tip" id="quota-tip"></span>
                        </div>
                        <div class="item">
                            <label>贷款期限：</label><asp:TextBox ID="txtQiXianStart" CssClass="inpt inpt-sm" data-format="number" runat="server"></asp:TextBox>
                            月 -<asp:TextBox ID="txtQiXianEnd" CssClass="inpt inpt-sm" data-format="number" runat="server"></asp:TextBox>
                            月
                        </div>
                        <div class="item">
                            <label>审批时间：</label><asp:TextBox ID="txtShenPiTimeStart" CssClass="inpt inpt-sm" data-format="number" runat="server"></asp:TextBox>
                            个工作日 -<asp:TextBox ID="txtShenPiTimeEnd" CssClass="inpt inpt-sm" data-format="number" runat="server"></asp:TextBox>
                            个工作日
                        </div>
                        <div class="clear"></div>
                        <h4>设置客户资质筛选问题。<span class="tail-text">（必填项）</span></h4>
                        <div id="popPermit" style="clear: both; width: 100%; overflow: hidden;">
                            <div>
                                <asp:HiddenField ID="SERVICEINFO" ClientIDMode="Static" runat="server" />
                                <asp:HiddenField ID="RAGE" ClientIDMode="Static" runat="server" />
                                <asp:HiddenField ID="RHOUSE" ClientIDMode="Static" runat="server" />
                                <asp:HiddenField ID="RCAR" ClientIDMode="Static" runat="server" />
                                <asp:HiddenField ID="RTRUST" ClientIDMode="Static" runat="server" />

                            </div>

                            <div id="permit_main" style="">
                                <div class="clearfix">
                                    <div style="padding: 0 10px; float: left; height: 100%; width: 100%;" id="permit-div">
                                        <h3>您要求客户回答的问题。（根据产品要求的资质正确勾选，有助于筛选掉<span class="red">不符合要求</span>的客户）</h3>
                                        <div id="zr_error"><span class="red">请您选择符合办理条件的客户资质问题。</span>根据产品要求正确设置问题，提升<span class="red">80%</span>下单客户质量。</div>
                                        <ul class="question_list left">
                                            <li class="item" id="item-1">
                                                <div class="item-vals">
                                                    <span style="width: 90px; overflow: hidden; float: left;">职业身份</span><asp:DropDownList ID="radioType" runat="server">
                                                        <asp:ListItem Value="0" Selected="True">不限</asp:ListItem>
                                                        <asp:ListItem Value="52">个人</asp:ListItem>
                                                        <asp:ListItem Value="53">企业</asp:ListItem>

                                                    </asp:DropDownList>
                                                </div>
                                            </li>

                                            <li class="item" id="item-3">&nbsp;&nbsp;<b>企业：</b>
                                                <div id="span_EnterPriseInfo" class="item-vals">
                                                    <asp:Repeater ID="R_EnterPriseType" runat="server">
                                                        <ItemTemplate>
                                                            <div class="divstyle"><span class="spanstyle"><%#Eval("name") %></span><%#GetServiceChildUrl(Eval("id").ToString()) %></div>
                                                        </ItemTemplate>

                                                    </asp:Repeater>
                                                </div>
                                            </li>
                                            <li>
                                                <div class="clear"></div>
                                            </li>
                                            <li class="item" id="item-2">&nbsp;&nbsp;<b>个人：</b>
                                                <div id="span_ServiceInfo" class="item-vals">
                                                    <asp:Repeater ID="R_ServiceType" runat="server">
                                                        <ItemTemplate>
                                                            <div class="divstyle"><span class="spanstyle"><%#Eval("name") %></span><%#GetServiceChildUrl(Eval("id").ToString()) %></div>
                                                        </ItemTemplate>
                                                    </asp:Repeater>

                                                </div>
                                            </li>
                                            <li>
                                                <div class="clear"></div>
                                            </li>
                                            <li class="item" id="item-4">&nbsp;&nbsp;<b>其它：</b>
                                                <div id="span_Info" class="item-vals">

                                                    <div class="divstyle" id="span_Age">
                                                        <span style="width: 90px; overflow: hidden; float: left;">年龄限制</span>

                                                        <cc1:DropDownCheckList ID="ddl_Age" runat="server" DataTextField="Name" RepeatColumns="3" DisplayTextWidth="200" DataValueField="ID" DropImageSrc="./static/images/drop.gif" TextWhenNoneChecked="不限" DisplayTextList="Labels" ClientCodeLocation="./static/js/DropDownCheckList.js"></cc1:DropDownCheckList>

                                                    </div>
                                                    <div class="divstyle" id="span_House">
                                                        <span style="width: 90px; overflow: hidden; float: left;">名下房产</span><cc1:DropDownCheckList ID="ddl_House" runat="server" DataTextField="Name" RepeatColumns="3" DisplayTextWidth="200" DataValueField="ID" DropImageSrc="./static/images/drop.gif" TextWhenNoneChecked="不限" DisplayTextList="Labels" ClientCodeLocation="./static/js/DropDownCheckList.js"></cc1:DropDownCheckList>
                                                    </div>
                                                    <div class="divstyle" id="span_Car">
                                                        <span style="width: 90px; overflow: hidden; float: left;">名下车辆</span><cc1:DropDownCheckList ID="ddl_Car" runat="server" DataTextField="Name" RepeatColumns="3" DisplayTextWidth="200" DataValueField="ID" DropImageSrc="./static/images/drop.gif" TextWhenNoneChecked="不限" DisplayTextList="Labels" ClientCodeLocation="./static/js/DropDownCheckList.js"></cc1:DropDownCheckList>
                                                    </div>
                                                    <div class="divstyle" id="span_Trust">
                                                        <span style="width: 90px; overflow: hidden; float: left;">个人信用</span><cc1:DropDownCheckList ID="ddl_Trust" runat="server" DataTextField="Name" RepeatColumns="3" DisplayTextWidth="200" DataValueField="ID" DropImageSrc="./static/images/drop.gif" TextWhenNoneChecked="不限" DisplayTextList="Labels" ClientCodeLocation="./static/js/DropDownCheckList.js"></cc1:DropDownCheckList>
                                                    </div>
                                                </div>
                                            </li>

                                        </ul>
                                    </div>
                                </div>
                            </div>
                            <%--<iframe id="DataPermit" width="100%" height="600px" frameborder="no" scrolling="no" src="Content.aspx"></iframe>--%>
                        </div>
                        <div class="clear"></div>
                        <h4>收费方式<span class="tail-text">（全部为必填）</span></h4>
                        <div class="item">
                            <label>平均每月综合费率：</label><asp:TextBox ID="txtMonthLiXi" CssClass="inpt inpt-sm" runat="server" Text="0"></asp:TextBox>
                        </div>
                        <div class="item">
                            <label>前期费用：</label><asp:TextBox CssClass="inpt inpt-sm" ID="txtQianQiCost" runat="server" Text="0"></asp:TextBox>
                        </div>
                        <div class="item">
                            <label>其他费用：</label><asp:TextBox ID="txtOtherCost" CssClass="inpt inpt-sm" Text="0" runat="server"></asp:TextBox>
                        </div>
                        <div class="item">
                            <label>还款方式：</label>
                            <span style="position: relative; top: 8px;">
                                <asp:DropDownList ID="Repayment" runat="server">
                                </asp:DropDownList>
                            </span>
                        </div>
                        <div class="item">
                            <label>提前还款说明：</label>
                            <asp:TextBox CssClass="inpt inpt-lg" ID="PayDescription" runat="server"></asp:TextBox>
                        </div>

                        <h4>产品详细描述<span class="tail-text">（请根据您的产品特点填写）</span></h4>
                        <div style="padding-left: 5px;">
                            <asp:TextBox ID="txtDescriptioin" runat="server" Height="108px" TextMode="MultiLine" Width="758px"></asp:TextBox>
                        </div>

                        <div class="clear"></div>
                        <h4>所需材料</h4>
                        <div id="TextDefault">
                            <p>
                                &nbsp;<input id="KnowListAll" type="checkbox" />全选
                            </p>
                            <div id="KnowAreas">
                                <asp:CheckBoxList ID="chkKnowList" name="chkKnowList" ClientIDMode="Static" runat="server"></asp:CheckBoxList>
                            </div>
                        </div>
                        <div class="clear"></div>
                        <h4>服务区域</h4>
                        <div class="selcity item" style="height: auto;">
                            <p>
                                &nbsp;<input id="ActionAreaAll" type="checkbox" />全选
                            </p>
                            <div id="DataAreas">
                                <asp:CheckBoxList ClientIDMode="Static" name="ddlServiceArea" ID="ddlServiceArea" runat="server"></asp:CheckBoxList>
                            </div>
                        </div>
                        <div class="item">
                            <asp:Button ID="btnSumbit" OnClientClick="Product.getService();" CssClass="btn btn-green" runat="server" Text="完成" OnClick="btnSumbit_Click" />
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="clear"></div>
    <div id="footer">
        <a href="http://www.xinranzixun.com/about" target="_blank">关于我们</a> | <a href="http://www.xinranzixun.com/collaborate/apply.html" target="_blank">信贷经理入驻</a> | <a href="http://www.xinranzixun.com/about/contact.html" target="_blank">联系我们</a> | <a href="http://www.xinranzixun.com/about/disclaimer.html" target="_blank">免责声明</a> | <a href="http://www.xinranzixun.com/about/feedback.html" target="_blank">建议与投诉</a><br />
        Copyright &copy;2013 XinRanZiXun.com Inc. All Rights Reserved.<span style="padding-left: 10px;"><a href="http://www.miibeian.gov.cn/" target="_blank">京ICP备12000680号-1</a></span><span style="padding-left: 10px;">京公网安备110108008323号</span>
    </div>
    <div id="online_qq_layer">
        <div id="online_qq_tab">
            <a id="floatShow" style="display: block;" href="javascript:void(0);" ra-data-ca="product/add">收缩</a>
            <a id="floatHide" style="display: none;" href="javascript:void(0);">展开</a>
        </div>
        <div id="onlineService">
            <div class="os-list os-fwb" style="margin-top: 5px;">
                您的商务顾问
            </div>
            <div class="os-list">
                陈经理: 
                <span class="os-orange">18910436970</span>
            </div>
            <div class="os-line">&nbsp;</div>
            <div class="os-list os-fwb" style="margin-top: 10px;">
                操作疑问, 或提建议
            </div>
            <div class="os-list">
                客服电话: <span class="os-orange">4008-190-360</span>
            </div>
        </div>
    </div>
    <script src="./static/js/jquery.stripe.js"></script>
    <script src="./static/js/jquery.resize.min.js"></script>
    <script type="text/javascript" src="./static/js/improve_tips.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            improve_tips.show_tips();
            $('.tb-list tbody tr').stripe();
            if ('undefined' != typeof (config) && config.unread_count && config.unread_count > 0) {
                $('#unread-count').html('(' + config.unread_count + ')').show();
            }
            $('#main').height($('#rightmain').height());
            $('#footer').show();
            $('#rightmain').resize(function () {
                $('#main').height($('#rightmain').height());
            });

            $('img').each(function () {
                var img = $(this);
                var def = img.attr('def');
                //console.log(def);
                if (def && def.length > 0) {
                    img.bind('error', function () {
                        var src = 'http://www.xinranzixun.com/static.rong360.com/img/' + def;
                        img.attr('src', src);
                        img.unbind('error');
                    });
                }
            });


            /** online servie */
            $("#floatShow").bind("mouseover", function () {
                $("#onlineService").animate({
                    width: "180px", opacity: "show"
                }, "normal", function () {
                });

                $("#floatShow").hide();
                $("#floatHide").show();
            });

            $("#floatHide").bind("mouseout", function () {
                $("#onlineService").animate({
                    width: "0", opacity: "hide"
                }, "normal", function () {
                });

                $("#floatShow").show();
                $("#floatHide").hide();
            });
        });
        //$("#sel5 option").each(function(i) {
        //    alert($(this).val());
                    
        //});
        function selChange(obj,sel) {
            if (sel !=null) {
                var objid=obj.id;
                var textvalues = [];
                $("#"+objid+" option").each(function(i) {
                    if($(this).val()==sel){
                        $("#subsel_" + sel).show();
                    }
                    else{
                        textvalues.push($(this).val());
                    }
                    
                });
                for (var i = 0; i < textvalues.length; i++) {
                    $("#subsel_" + textvalues[i]).hide();
                }
                if($("#subsel_" + sel).size()==0 && sel !="0"){
                    for (var i = 0; i < textvalues.length; i++) {
                        $("#subsel_" + textvalues[i]).show();
                    }
                }

            }

        }
        function selChildChange(sel){

        }

        $(function(){
            $("#radioType").change(function(){
                var value=$(this).val();
                if(value=="0"){
                    $("#item-3").show();
                    $("#item-2").show();
                }
                else if(value=="52"){
                    $("#item-3").hide();
                    $("#item-2").show();
                }
                else if(value=="53"){
                    $("#item-3").show();
                    $("#item-2").hide();
                }
            });
        });

    </script>


    <script type="text/javascript">
        PopLayer.resize = function (size) {
            return false;
        }

        var Product = {
            init: function () {

            },
            returnPop: function (data) {
                $("#DataZhuiru").val(JSON.stringify(data));
                $.ajax({
                    type: 'POST',
                    url: 'http://www.xinranzixun.com/product/autotags',
                    data: {
                        loan_cycle: $("#DataOpenTime").val(),
                        strProductPermit: $("#DataZhuiru").val()
                    },
                    success: function (data) {
                        //console.log($.parseJSON(data));
                        $("#TagAuto").parent().show();
                        $("#TagAuto").html($.parseJSON(data).join(","));
                        $("#DataTagAuto").attr("value", $.parseJSON(data).join(","));
                        $('#product-tag').show();
                    },
                    error: function (xhr, type) {
                        alert('获取失败，请稍候再试！')
                    }
                });
            },
            updatePerData: function (data) {
                $("#DataZhuiru").val(JSON.stringify(data));
            },
            showPopPro: function () {
                openDialog("#popProduct");
            },
            goPopPro: function () {
                window.location.href = "http://www.xinranzixun.com/product/add?copy=" + $("[name='selectProduct']:checked").val()
            },
            getAll:function(objid,val){
                if (objid !=null) {
                    var textvalues="";
                    $("#"+objid+" option").each(function(i) {
                        if($(this).val()!=val){
                            textvalues +=$(this).val()+",";
                        }
                    });
                    return textvalues;
                    
                }
            },
            getService: function () {
                var serviceCount=<%=ServiceCount %>;
                var ageID="";
                var houseID = "";
                var carID = "";
                var trustID = "";
                var serviceInfo = "";
                //debugger;
                var currentObj=null;
                for(var i=1;i<=serviceCount;i++){
                    currentObj=$("#sel"+i);
                    if(currentObj){
                        var currentValue=$("#sel"+i+" option:selected").val();
                        if(currentValue !=null && currentValue !="")
                        {
                            if(currentValue=="0"){
                                serviceInfo+=this.getAll("sel"+i,0);
                            }
                            else
                            {
                                serviceInfo += currentValue+",";
                            }
                        }
                    }
                }
                
                //alert(serviceInfo);
                currentObj=$("#ddl_House");
                if(currentObj){
                    var currentValue=$("#ddl_House option:selected").val();
                    if(currentValue !=null && currentValue !="" ){
                        if(currentValue=="0"){
                            houseID+=this.getAll("ddl_House",0);
                        }
                        else{
                            houseID += currentValue+",";
                        }
                    }
                }
                $("#RHOUSE").val(houseID);
                currentObj=$("#ddl_Age");
                if(currentObj){
                    var currentValue=$("#ddl_Age option:selected").val();
                    if(currentValue !=null && currentValue !="" ){
                        if(currentValue=="0"){
                            ageID+=this.getAll("ddl_Age",0);
                        }
                        else{
                            ageID += currentValue+",";
                        }
                    }
                }
                $("#RAGE").val(ageID);
                //alert(houseID);
                currentObj=$("#ddl_Car");
                if(currentObj){
                    var currentValue=$("#ddl_Car option:selected").val();
                    if(currentValue !=null && currentValue !="" ){
                        if(currentValue=="0"){
                            carID+=this.getAll("ddl_Car",0);
                        }
                        else{
                            carID += currentValue+",";
                        }
                    }
                }
                $("#RCAR").val(carID);
                //alert(carID);
                currentObj=$("#ddl_Trust");
                if(currentObj){
                    var currentValue=$("#ddl_Trust option:selected").val();
                    if(currentValue !=null && currentValue !="" ){
                        if(currentValue=="0"){
                            trustID+=this.getAll("ddl_Trust",0);
                        }
                        else{
                            trustID += currentValue+",";
                        }
                    }
                }
                $("#RTRUST").val(trustID);
                var ChildServiceCount=<%=ChildServiceCount %>;
                var childObject=null;
                var currentValue="";
                for(var j=1;j<=ChildServiceCount;j++){
                    //debugger;
                    childObject=$("#subChildSel_"+j);
                    var _hidden=$("#subChildSel_"+j).is(":hidden");
                    childObject="subChildSel_"+j;
                    if(_hidden ==true){
                        //如果隐藏，说明条件不限,取当前控件的所有下拉值
                        
                        $("#"+childObject+" option").each(function(i) {
                            if($(this).val() !="0"){
                                currentValue+=$(this).val()+",";
                            }
                    
                        });

                        serviceInfo+=currentValue;
                        currentValue="";
                    }
                    else{
                        //如果显示，判断选中哪一个，如果选中是０,则还是获取所有,否则为当前值
                        currentValue=$("#subChildSel_"+j+" option:selected").val();
                        if(currentValue !=null && currentValue !="")
                        {
                            if(currentValue=="0"){
                                currentValue="";
                                currentValue+=this.getAll("subChildSel_"+j,0);
                            }
                            else
                            {
                                currentValue += ",";
                            }
                        }
                        serviceInfo+=currentValue;
                        currentValue="";
                    }
                }
                
                $("#SERVICEINFO").val(serviceInfo);
                //alert(trustID);
            }
        };
        $(document).delegate("[data-click]", "click", function (e) {
            e.preventDefault();
            Product[$(this).data("click")]();
        });

        
        function checkFees() {
            var fees1 = $('input[name="pdata[other_fees][month_rate_type]"]:checked');
            var fees2 = $('input[name="pdata[other_fees][once_rate_type]"]:checked');
            var fees3 = $('input[name="pdata[other_fees][danbao_rate_type]"]:checked');

            if (fees1.val() == 0 && fees2.val() == 0 && fees3.val() == 0) {
                $('#fees_error').addClass('error').show();
                return false;
            }
            else {
                $('#fees_error').removeClass('error').hide();
                return true;
            }
        }
        function mScroll(e) {
            e.focus();
            $("html,body").stop(true); $("html,body").animate({
                scrollTop: e.offset().top
            }, 1000);
        }
        $("#DataZhuiru").attr("value", $("#DataSrcZr").val());
        $("#DataPost").submit(function () {
            var key = true;
            $('input.inpt').each(function (index, item) {
                var _for = $($(item).attr("data-for"));
                if (_for.attr("type") == "radio") {
                    var _forKey = (_for.attr("checked")) ? true : false;
                } else {
                    var _forKey = true;
                }
                if ($(item).val() == "" && _forKey) {
                    //$(item).focus();
                    $(item).addClass("error");
                    key = false;
                    //break;
                }
                else {
                    $(item).removeClass("error");
                }
            });
            $("select").each(function (index, item) {
                if (!$(this).find("option:selected").val()) {
                    $(this).addClass("error");
                    key = false;
                } else {
                    $(this).removeClass("error");
                }
            });

            //对费用检查
            if (!checkFees()) {
                key = false;
            }

            if (!key) {
                alert('您有尚未填写全的信息');
                if ($('.error').first()) {
                    mScroll($('.error').first());
                }
            }
            return key;
        });
        //区域全先逻辑
        $(document).delegate("#ActionAreaAll", "click", function () {
            if ($(this).attr("checked")) {
                $("#DataAreas input[type=checkbox]").attr("checked", true);
            } else {
                $("#DataAreas input[type=checkbox]").attr("checked", false);
            }
        });
        $(document).delegate("#KnowListAll", "click", function () {
            if ($(this).attr("checked")) {
                $("#KnowAreas input[type=checkbox]").attr("checked", true);
            } else {
                $("#KnowAreas input[type=checkbox]").attr("checked", false);
            }
        });

        //input限制输入
        $(document).delegate("input[data-format]", "keyup", function (e) {
            var caseType = $(this).data("format");
            if (caseType == "number") {
                $(this).val($(this).val().replace(/[^\d.]/g, ''));
            }
        });

        function Resize(height) {
            $("#popPermit").height(height);
        }

    </script>
</body>
</html>
